#include "devices/keyboard.h"
#include "system/window.h"

void _esdlKeyboardInit(EsdlKeyboard* keyboard) {
    int i;
    for (i = 0; i < 512; i++) {
        keyboard->keys[i] = false;
    }
}

void _esdlKeyboardSet(EsdlKeyboard* keyboard, EsdlKey key, bool pressed) {
    keyboard->keys[key] = pressed;
}

bool _esdlKeyboardIsKeyPressed(const EsdlKeyboard* keyboard, EsdlKey key) {
    return keyboard->keys[key];
}

bool esdlIsKeyPressed(EsdlKey key) {
    return _esdlKeyboardIsKeyPressed(esdlGetKeyboard(), key);
}
